1. /* sxfbcos.cpp by K.Tsuru */
  2. // function ID 5201 BRADIX
  3. #ifndef SN_H
  4. #include "sn.h"
  5. #endif
  6. /**************
  7. SDecimal class
  8. cos x
  9. ****************/
  10. SDecimal Bcos(const SDouble& x){
  11. SDecimal r;
  12. SDouble y;
  13. int func = COS_CALC;
  14. int s = GetTriCalcMethod(x, y, &func);
  15. if(s == 0){
  16. r = y.Sign(5201); // y = -1, 0, 1
  17. // must return SDecimal object.
  18. x.upToTerm = 1;
  19. } else if(func == COS_CALC) r = BcosSeries(y);
  20. else r = BsinSeries(y);
  21. if(s < 0) r.ChangeSign(); // r = -r;
  22. return r;
  23. }

sxfbcos.cpp : last modifiled at 2015/12/15 13:58:25(523 bytes)
created at 2015/12/22 16:09:56
The creation time of this html file is 2017/10/27 15:45:59 (Fri Oct 27 15:45:59 2017).